package com.njtoyo.taxi.admin.logic.business;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.njtoyo.taxi.admin.mapper.master.entity.User;
import com.njtoyo.taxi.admin.mapper.master.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

@Service
public class UserLogic {
    @Autowired
    private UserMapper userMapper;

    public List<User> selectUserNameMobileHasUniqueUuidByIds(Set<Long> userIds) {
        return new LambdaQueryChainWrapper<>(userMapper)
                .select(User::getId, User::getName, User::getMobileNumber, User::getHasUniqueUuid)
                .in(User::getId, userIds)
                .list();
    }

    public User selectUserNameMobileById(Long userId) {
        return new LambdaQueryChainWrapper<>(userMapper)
                .select(User::getId, User::getName, User::getMobileNumber)
                .eq(User::getId, userId)
                .one();
    }
}
